<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <h2>检测复杂数据类型</h2>
</body>
<script>
    let arr=[323,3,23,23,234]
    let obj={}
    let d=new Date();
    let reg=new RegExp();
    let fn=function() {}
    // console.log(typeof arr)
    // console.log(typeof obj)
    // console.log(typeof d)
    // console.log(typeof reg)
    // console.log(typeof fn)
    //检测数组
    // console.log(Array.isArray(arr))
    // console.log(Array.isArray(obj))
    // console.log(Array.isArray(d))
    // console.log(Array.isArray(reg))
    // console.log(Array.isArray(fn))
    // console.log(Object.prototype.toString.call(arr)==='[object Array]')
    // console.log(Object.prototype.toString.call(obj)==='[object Array]')
    // console.log(Object.prototype.toString.call(d)==='[object Array]')
    // console.log(Object.prototype.toString.call(reg)==='[object Array]')

    // function isArray(target) {
    //     return Object.prototype.toString.call(target)==='[object Array]'
    // }

    // console.log(isArray(arr))
    console.log(Object.prototype.toString.call(null)==='[object Null]')
</script>
</html>